<?php

require_once('myPDO.php');

$dsn = 'mysql:dbname=Prueba;host=localhost';
$user = 'root';
$password = 'root';

try {
    $dbh = new myPDO($dsn, $user, $password);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}
$miguel = "miguel";
;
$sql = 'SELECT Nombre, Apellido FROM Tabla WHERE Nombre= :variable';
$sth = $dbh->prepare($sql);
$bindParam = $sth->bindParam(':variable', $miguel);

$sth->execute();
$result = $sth->fetch(PDO::FETCH_ASSOC);

$sth->closeCursor();
$dbh = null;
print_r($result);

/*
foreach ($result as $valor) {
        print "<pre>\n";
        print_r($valor);
        print "</pre>\n";
    }*/

var_dump($sth);
//$red = $sth->fetchAll();

?>
